import { makeRequest } from '../client-core'
import type { LoginIn, LoginToken } from './models'

const request = makeRequest('/api/v1')

export class Accounts extends request('/account') {
  static login(data: LoginIn) {
    return Accounts.$api.post<LoginToken>({ sub: '/login', data })
  }

  static logout() {
    return Accounts.$api.post({ sub: '/logout' })
  }
}
